package com.xyh.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xyh.po.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

/**
 * @Author:kyle
 * @Date:2020/12/23 - 14:07
 * @Project:spring_StudentsDormitoryManagementSystem
 * @Package:com.xyh.dao
 * @Version:1.0
 */
@Repository
public interface UserDao extends BaseMapper<User> {

    //用户登录，获得用户相关信息
    @Select("select username from t_user where username=#{username} and password=#{password}")
    @ResultMap("com.xyh.dao.UserDao.userMap")
    User login(@Param("username") String username, @Param("password") String password);
}
